<?php
if(cmd("lag")) send('PING :Checkinglag ' . microtime(true) . " $args[2] $source_nick");

if(($command == "PONG") && ($msg_args[0] == 'Checkinglag')){
    $lag=number_format(microtime(true)-($msg_args[1]),3);
    msg("$msg_args[3]: Current lag for $nickname: $lag seconds.", $msg_args[2]);
}
?>